﻿<UserControl x:Class="wathammer40kListBuilder.View.NewArmyPanel"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             xmlns:loc="clr-namespace:wathammer40kListBuilder.ViewModel"
             mc:Ignorable="d" 
             d:DesignHeight="300" d:DesignWidth="300">
    <UserControl.Resources>
        <DataTemplate DataType="{x:Type loc:SquadTypeViewModel}">
            <Grid>
                <Grid.RowDefinitions>
                    <RowDefinition Height="Auto" />
                    <RowDefinition Height="Auto" />
                </Grid.RowDefinitions>  
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="200" />
                    <ColumnDefinition Width="Auto" />
                    <ColumnDefinition Width="200" />
                    <ColumnDefinition Width="*" />
                </Grid.ColumnDefinitions>
                <Label Grid.Column="0" Grid.Row="0" Content="{Binding Name}"/>
                <Label Grid.Column="1" Grid.Row="0" Content="nombre minimum"/>
                <Label Grid.Column="1" Grid.Row="1" Content="nombre maximum"/>
                <TextBox Grid.Column="2" Grid.Row="0" Text="{Binding NbMinimum}" />
                <TextBox Grid.Column="2" Grid.Row="1" Text="{Binding NbMaximum}" />
            </Grid>
        </DataTemplate>
    </UserControl.Resources>
<Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="*"/>
            <RowDefinition Height="Auto"/>
        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="Auto" />
            <ColumnDefinition Width="*"/>
            <ColumnDefinition Width="Auto"/>
        </Grid.ColumnDefinitions>
        <Label Grid.Column="0" Grid.Row="0" Margin="2">
            Nom de l'armée :
        </Label>
        <TextBox Grid.Column="1" Grid.Row="0" Margin="2" Text="{Binding Path=Name}"></TextBox>
        <ListBox ItemsSource="{Binding SquadTypes}" Grid.Column="0" Grid.Row="1" Grid.ColumnSpan="3" />
            

        <Button Grid.Column="2" Grid.Row="2" Content="Enregistrer" Margin="3" Name="SaveButton" Click="SaveButton_Click" />
    </Grid>
</UserControl>
